home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / doom / turric03.zip / TURRIC03.ZIP / PROGS / M-DEMON.QC < prev    next >
Text File  |  1997-01-30  |  13KB  |  390 lines

  1. /*
  2. ==============================================================================
  3.  
  4. DEMON MORPH
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. $cd /raid/quake/id1/models/demon3
  10. $scale    0.8
  11. $origin 0 0 24
  12. $base base
  13. $skin base
  14.  
  15. $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9
  16. $frame stand10 stand11 stand12 stand13
  17.  
  18. $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8
  19.  
  20. $frame run1 run2 run3 run4 run5 run6
  21.  
  22. $frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10
  23. $frame leap11 leap12
  24.  
  25. $frame pain1 pain2 pain3 pain4 pain5 pain6
  26.  
  27. $frame death1 death2 death3 death4 death5 death6 death7 death8 death9
  28.  
  29. $frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8
  30. $frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15
  31.  
  32. //** PATCH_BEGIN - morph2 - Turrican ****
  33. void(float h_dir, float v_dir) player_demon_melee =
  34. {
  35.     local   vector  source, org;
  36.     local    vector    offang;
  37.     local   float   ldmg;
  38.  
  39.     sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
  40.  
  41.     offang = self.v_angle;
  42.     offang_y = offang_y + h_dir;
  43.     offang_x = offang_x + v_dir;
  44.  
  45.     makevectors (offang);
  46.  
  47.     source = self.origin + '0 0 4';
  48.     traceline (source, source + v_forward* 80, FALSE, self);
  49.     if (trace_fraction == 1.0)
  50.         return;
  51.  
  52.     org = trace_endpos - v_forward*4;
  53.  
  54.     if (trace_ent.takedamage)
  55.     {
  56.         sound (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM);
  57.         ldmg = 40 + 10*random();
  58.         T_Damage (trace_ent, self, self, ldmg);
  59.  
  60.         trace_ent.axhitme = 1;
  61.         spawn_touchblood (40);
  62.  
  63.         SpawnMeatSpray (org, v_right * 16);
  64.     }
  65.     else
  66.     {    // hit wall
  67.         sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);
  68.         WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  69.         WriteByte (MSG_BROADCAST, TE_GUNSHOT);
  70.         WriteCoord (MSG_BROADCAST, org_x);
  71.         WriteCoord (MSG_BROADCAST, org_y);
  72.         WriteCoord (MSG_BROADCAST, org_z);
  73.     }
  74. };
  75.  
  76. // left slash attack
  77. void()  player_demon_attack_l1 = [$attacka1, player_demon_attack_l2 ] {self.view_ofs = '0 0 8';};
  78. void()  player_demon_attack_l2 = [$attacka2, player_demon_attack_l3 ] {self.view_ofs = '0 0 16';};
  79. void()  player_demon_attack_l3 = [$attacka3, player_demon_attack_l4 ] {self.view_ofs = '0 0 25';};
  80. void()  player_demon_attack_l4 = [$attacka4, player_demon_attack_l5 ] {self.view_ofs = '0 0 23';};
  81. void()  player_demon_attack_l5 = [$attacka5, player_demon_attack_l6 ] {self.view_ofs = '0 0 21'; player_demon_melee(20, 10);};
  82. void()  player_demon_attack_l6 = [$attacka6, player_demon_attack_l7 ] {self.view_ofs = '0 0 16';};
  83. void()  player_demon_attack_l7 = [$attacka7, player_demon_attack_l8 ] {self.view_ofs = '0 0 8';};
  84. void()  player_demon_attack_l8 = [$attacka8, player_stand1 ] {self.view_ofs = '0 0 4';};
  85.  
  86. // right slash attack
  87. void()  player_demon_attack_r1 = [$attacka1, player_demon_attack_r2 ] {self.view_ofs = '0 0 8';};
  88. void()  player_demon_attack_r2 = [$attacka9, player_demon_attack_r3 ] {self.view_ofs = '0 0 16';};
  89. void()  player_demon_attack_r3 = [$attacka10, player_demon_attack_r4 ] {self.view_ofs = '0 0 23';};
  90. void()  player_demon_attack_r4 = [$attacka11, player_demon_attack_r5 ] {self.view_ofs = '0 0 21'; player_demon_melee(-20, 10);};
  91. void()  player_demon_attack_r5 = [$attacka12, player_demon_attack_r6 ] {self.view_ofs = '0 0 16';};
  92. void()  player_demon_attack_r6 = [$attacka13, player_demon_attack_r7 ] {self.view_ofs = '0 0 12';};
  93. void()  player_demon_attack_r7 = [$attacka14, player_demon_attack_r8 ] {self.view_ofs = '0 0 8';};
  94. void()  player_demon_attack_r8 = [$attacka15, player_stand1 ] {self.view_ofs = '0 0 4';};
  95.  
  96. // combination l-r slash attack
  97. void()  player_demon_attack_lr1 = [$attacka1, player_demon_attack_lr2 ] {self.view_ofs = '0 0 8';};
  98. void()  player_demon_attack_lr2 = [$attacka2, player_demon_attack_lr3 ] {self.view_ofs = '0 0 16';};
  99. void()  player_demon_attack_lr3 = [$attacka3, player_demon_attack_lr4 ] {self.view_ofs = '0 0 25';};
  100. void()  player_demon_attack_lr4 = [$attacka4, player_demon_attack_lr5 ] {self.view_ofs = '0 0 23';};
  101. void()  player_demon_attack_lr5 = [$attacka5, player_demon_attack_lr6 ] {self.view_ofs = '0 0 21'; player_demon_melee(20, 10);};
  102. void()  player_demon_attack_lr6 = [$attacka6, player_demon_attack_lr7 ] {self.view_ofs = '0 0 23';};
  103. void()  player_demon_attack_lr7 = [$attacka7, player_demon_attack_lr8 ] {self.view_ofs = '0 0 24';};
  104. void()  player_demon_attack_lr8 = [$attacka8, player_demon_attack_lr9 ] {self.view_ofs = '0 0 25';};
  105. void()  player_demon_attack_lr9 = [$attacka9, player_demon_attack_lr10 ] {self.view_ofs = '0 0 24';};
  106. void()  player_demon_attack_lr10 = [$attacka10, player_demon_attack_lr11 ] {self.view_ofs = '0 0 23';};
  107. void()  player_demon_attack_lr11 = [$attacka11, player_demon_attack_lr12 ] {self.view_ofs = '0 0 21'; player_demon_melee(-20, 10);};
  108. void()  player_demon_attack_lr12 = [$attacka12, player_demon_attack_lr13 ] {self.view_ofs = '0 0 16';};
  109. void()  player_demon_attack_lr13 = [$attacka13, player_demon_attack_lr14 ] {self.view_ofs = '0 0 12';};
  110. void()  player_demon_attack_lr14 = [$attacka14, player_demon_attack_lr15 ] {self.view_ofs = '0 0 8';};
  111. void()  player_demon_attack_lr15 = [$attacka15, player_stand1 ] {self.view_ofs = '0 0 4';};
  112.  
  113. void () player_demon_attack =
  114. {
  115.     if (self.weapon == DEMON_SLASH_L)
  116.     {
  117.         self.attack_finished = time + 0.7;
  118.         player_demon_attack_l1();
  119.     }
  120.     else if (self.weapon == DEMON_SLASH_R)
  121.     {
  122.         self.attack_finished = time + 0.7;
  123.         player_demon_attack_r1();
  124.     }
  125.     else if (self.weapon == DEMON_SLASH_LR)
  126.     {
  127.         self.attack_finished = time + 1.4;
  128.         player_demon_attack_lr1();
  129.     }
  130.  
  131. };
  132. //** PATCH_END - morph2 - Turrican ******
  133.  
  134. void() player_demon_jumptouch =
  135. {
  136.         local float ldmg;
  137.  
  138.         if(other.takedamage)
  139.         {
  140.                 ldmg = 40 + 10*random();
  141.                 T_Damage(other, self, self, ldmg);
  142.                 SpawnMeatSpray (self.origin + v_forward*20,  100* v_forward);
  143.                 SpawnMeatSpray (self.origin + v_forward*20,  50* v_forward);
  144.         }
  145.  
  146.         self.touch = SUB_Null;
  147. };
  148.  
  149. void() player_demon_jump1 = [ $leap1, player_demon_jump1 ] {
  150.         if (self.walkframe >= 12)
  151.                 self.walkframe = 11;
  152.         self.frame = $leap1 + self.walkframe;
  153.         self.walkframe = self.walkframe + 1;
  154.         if (self.flags & FL_ONGROUND) {
  155.         self.touch = SUB_Null;
  156.                 player_stand1();
  157.     }
  158. };
  159.  
  160. void() player_demon_jump = {
  161.     makevectors(self.v_angle);
  162.     self.origin_z = self.origin_z + 1;
  163.     self.velocity = v_forward * 800 + '0 0 350';
  164.     sound(self, CHAN_BODY, "demon/djump.wav", 1, ATTN_NORM);
  165.     self.touch = player_demon_jumptouch;
  166.     player_demon_jump1();
  167. };
  168.  
  169. void() player_demon_stand = [ $stand1, player_stand1 ] {
  170.     if(self.walkframe >= 13)
  171.         self.walkframe=0;
  172.     self.frame = $stand1 + self.walkframe;
  173.     self.walkframe = self.walkframe + 1;
  174. };
  175.  
  176. void() player_demon_run = [ $run1, player_run ] {
  177.     if(self.walkframe >= 6)
  178.         self.walkframe = 0;
  179.     self.frame = $run1 + self.walkframe;
  180.     self.walkframe = self.walkframe + 1;
  181. };
  182.  
  183. //** PATCH_BEGIN - morph2 - Turrican ****
  184. /*
  185. void() player_demon_pain = [       $pain5, player_demon_pain1    ]
  186. {
  187.         self.walkframe = 1;
  188.         PainSound();
  189.         self.weaponframe = 0;
  190.         self.frame = $pain5;
  191. };
  192.  
  193. void()  player_demon_pain1 =  [      $pain1, player_demon_pain1    ]
  194. {
  195.         if (self.walkframe >=10)
  196.                 player_stand1();
  197.         if (self.walkframe < 6)
  198.                 self.frame = $pain5 + self.walkframe;
  199.         else self.frame = $pain5 + (10 - self.walkframe);
  200.         self.walkframe = self.walkframe + 1;
  201. };
  202. */
  203.  
  204. void()    player_demon_pain1    =[    $pain1,        player_demon_pain2    ] {self.view_ofs = '0 0 8';};
  205. void()    player_demon_pain2    =[    $pain2,        player_demon_pain3    ] {self.view_ofs = '0 0 16';};
  206. void()    player_demon_pain3    =[    $pain3,        player_demon_pain4    ] {self.view_ofs = '0 0 24';};
  207. void()    player_demon_pain4    =[    $pain4,        player_demon_pain5    ] {self.view_ofs = '0 0 16';};
  208. void()    player_demon_pain5    =[    $pain5,        player_demon_pain6    ] {self.view_ofs = '0 0 10';};
  209. void()    player_demon_pain6    =[    $pain6,        player_stand1        ] {self.view_ofs = '0 0 4';};
  210.  
  211. void ()    player_demon_pain =
  212. {
  213.     if (self.touch == player_demon_jumptouch)
  214.         return;
  215.  
  216.     if (self.pain_finished > time)
  217.         return;
  218.  
  219.     PainSound();
  220.  
  221.     self.pain_finished = time + 0.5;
  222.     self.attack_finished = time + 0.5;
  223.  
  224.     player_demon_pain1 ();
  225. };
  226.  
  227. void() player_demon_impulse =
  228. {
  229.     if(self.impulse > 3 && self.impulse < 11)
  230.     {
  231.         self.impulse = 0;
  232.         return;
  233.     }
  234.  
  235. // Choose weapon.
  236.     if (self.impulse == 1)
  237.         self.weapon = DEMON_SLASH_L;
  238.     else if (self.impulse == 2)
  239.         self.weapon = DEMON_SLASH_R;
  240.     else if (self.impulse == 3)
  241.         self.weapon = DEMON_SLASH_LR;
  242.  
  243. // Cycle weapon.
  244.     else if (self.impulse == 11)
  245.     {
  246.         if (self.weapon == DEMON_SLASH_L)
  247.             self.weapon = DEMON_SLASH_R;
  248.         else if (self.weapon == DEMON_SLASH_R)
  249.             self.weapon = DEMON_SLASH_LR;
  250.         else if (self.weapon == DEMON_SLASH_LR)
  251.             self.weapon = DEMON_SLASH_L;
  252.     }
  253.     else if (self.impulse == 12)
  254.     {
  255.         if (self.weapon == DEMON_SLASH_L)
  256.             self.weapon = DEMON_SLASH_LR;
  257.         else if (self.weapon == DEMON_SLASH_LR)
  258.             self.weapon = DEMON_SLASH_R;
  259.         else if (self.weapon == DEMON_SLASH_R)
  260.             self.weapon = DEMON_SLASH_L;
  261.     }
  262.  
  263. // Inform player of change.
  264.         if (self.weapon == DEMON_SLASH_L)
  265.             sprint(self, "Left Slash\n");
  266.         else if (self.weapon == DEMON_SLASH_R)
  267.             sprint(self, "Right Slash\n");
  268.         else if (self.weapon == DEMON_SLASH_LR)
  269.             sprint(self, "Combination Slash\n");
  270.  
  271.     self.impulse = 0;
  272. };
  273.  
  274. void()    player_demon_die1        =[    $death1,    player_demon_die2    ] {};
  275. void()    player_demon_die2        =[    $death2,    player_demon_die3    ] {};
  276. void()    player_demon_die3        =[    $death3,    player_demon_die4    ] {};
  277. void()    player_demon_die4        =[    $death4,    player_demon_die5    ] {};
  278. void()    player_demon_die5        =[    $death5,    player_demon_die6    ] {};
  279. void()    player_demon_die6        =[    $death6,    player_demon_die7    ] {};
  280. void()    player_demon_die7        =[    $death7,    player_demon_die8    ] {};
  281. void()    player_demon_die8        =[    $death8,    player_demon_die9    ] {};
  282. void()    player_demon_die9        =[    $death9,    player_demon_die9 ]
  283. //** PATCH_BEGIN - gibbin3 - Turrican ****
  284. {
  285.     PlayerDead();
  286.     MakePlayerCorpse (self.max_health * self.health_modifier * 0.65,
  287.                       '-32 -32 -24', '32 32 -12');
  288. };
  289. //** PATCH_END - gibbin3 - Turrican ******
  290.  
  291. void () player_demon_die =
  292. {
  293.     self.items = self.items - (self.items & IT_INVISIBILITY);
  294.     self.invisible_finished = 0;    // don't die as eyes
  295.     self.invincible_finished = 0;
  296.     self.super_damage_finished = 0;
  297.     self.radsuit_finished = 0;
  298.     self.view_ofs = '0 0 -8';
  299.     self.deadflag = DEAD_DYING;
  300.     self.flags = self.flags - (self.flags & FL_ONGROUND);
  301.     self.movetype = MOVETYPE_TOSS;
  302.     if (self.velocity_z < 10)
  303.         self.velocity_z = self.velocity_z + random()*300;
  304.  
  305. //** PATCH_BEGIN - gibbin3 - Turrican ****
  306. // Pass player size and head.mdl to Corpse_die using globals.
  307.     self.corpse_size = SIZE_MEDIUM;
  308.     self.head_gib_name = "progs/h_demon.mdl";
  309. //** PATCH_END - gibbin3 - Turrican ******
  310.  
  311. // check for gib
  312.     if (self.health < -80)
  313.     {
  314. //** PATCH_BEGIN - gibbin3 - Turrican ****
  315.         Corpse_die();
  316. //** PATCH_END - gibbin3 - Turrican ******
  317.         return;
  318.     }
  319.  
  320.     self.angles_x = 0;
  321.     self.angles_z = 0;
  322.  
  323.     DeathSound();
  324.  
  325. // regular death
  326.     player_demon_die1 ();
  327.  
  328. };
  329. //** PATCH_END - morph2 - Turrican ******
  330.  
  331. string() player_demon_killmsg = { return " was slashed by "; };
  332. string() player_demon_killmsg2 = { return "\n"; };
  333.  
  334. void() player_demon_become = {
  335. //** PATCH_BEGIN - morph2 - Turrican ****
  336. //    bprint(self.netname);
  337. //    bprint(" has become a fiend.\n");
  338.     sprint( self, "You have become a fiend.\n");
  339.  
  340. // Stop the morph from flying.
  341.     if (self.flags & FL_FLY)
  342.     {
  343.         localcmd("fly");
  344.         self.flags = self.flags - FL_FLY;
  345.     }
  346.     self._impulse = player_demon_impulse;
  347.     self._die = player_demon_die;
  348. //** PATCH_END - morph2 - Turrican ******
  349.     self._stand=player_demon_stand;
  350.     self._run=player_demon_run;
  351.     self._pain=player_demon_pain;
  352.     self._jump=SUB_Null;
  353.     self._jump2=player_demon_jump;
  354.     self._attack=player_demon_attack;
  355.     self._can_get_p=SUB_False;
  356.     self._killmsg=player_demon_killmsg;
  357.     self._killmsg2=player_demon_killmsg2;
  358.     setmodel(self,"progs/demon.mdl");
  359.     self.modelindex_morph=self.modelindex;
  360.     self.weaponmodel="";
  361. //** PATCH_BEGIN - morph2 - Turrican ****
  362.     self.view_ofs = '0 0 4';
  363.     if(!deathmatch)
  364.         setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  365.     else
  366.         setsize (self, VEC_HULL2_MIN, '32 32 32');
  367. //** PATCH_END - morph2 - Turrican ******
  368.     self.health = self.health * 5.00 / self.health_modifier;
  369.     self.health_modifier = 5.00;
  370.     makevectors(self.v_angle);
  371.     spawn_tfog(self.origin + 20 * v_forward);
  372.     DropBackpack2();
  373. //** PATCH_BEGIN - morph2 - Turrican ****
  374.     self.currentammo = 0;
  375.     self.weapon = DEMON_SLASH_LR;
  376. // Make morphs ignore player colors.
  377.     if (self.colormap != 0)
  378.     {
  379.         self.temp_colormap = self.colormap;
  380.         self.colormap = 0;
  381.     }
  382. // Make morphs ignore player skins.
  383.     if (self.skin != 0)
  384.     {
  385.         self.temp_skin = self.skin;
  386.         self.skin = 0;
  387.     }
  388. //** PATCH_END - morph2 - Turrican ******
  389. };
  390.